$(function () {
    //  生产总数旋转 start
    var r = 0;
    function radius() {
        r += 360;
        $("#radius").css('transform', 'rotate(' + r + 'deg)');
        $("#radu").css('transform', 'rotate(' + r + 'deg)');
    }
    
    radius();
    //  生产总数旋转 end
    $("#btns").click(function () {
        radius();
    })

})


function ss(){
    var myChart = echarts.init(document.getElementById('main'));
    var Chart = echarts.init(document.getElementById('cehcar'));
    // 指定图表的配置项和数据
    var data = [100, 34, 60, 70, 34, 60,]
    var titlename = ['太原市民政局', '太原市运输局', '太原市残联', '太原市民政局', '太原市运输局', '太原市残联'];
    // var titlename = ["./images/logo1.png", "./images/logo1.png", "./images/logo1.png",];

    var valdata = [683, 234, 234, 683, 234, 234]

    var myColor = ["#00a2e4"];
    option = {
        // backgroundColor: '#0e2147',
        xAxis: {
            show: false
        },
        yAxis: [{
            show: true,
            data: titlename,
            inverse: true,
            axisLine: {
                show: false
            },
            splitLine: {
                show: false
            },
            axisTick: {
                show: false
            },
            axisLabel: {
                color: '#fff',
                formatter: function (value, index) {
                    return [
                        '{lg|' + (index + 1) + '}' + '{title|' + value + '} '
                    ].join('\n')
                },
                rich: {
                    lg: {
                        backgroundColor: '#339911',
                        color: '#fff',
                        borderRadius: 15,
                        // padding: 5,
                        align: 'center',
                        width: 5,
                        height: 5
                    },
                }
            },


        }, {
            show: true,
            inverse: true,
            data: valdata,
            axisLabel: {
                textStyle: {
                    fontSize: 12,
                    color: '#fff',
                },
            },
            axisLine: {
                show: false
            },
            splitLine: {
                show: false
            },
            axisTick: {
                show: false
            },

        }],
        series: [{
            name: '条',
            type: 'bar',
            yAxisIndex: 0,
            data: data,
            barWidth: 10,
            itemStyle: {
                normal: {
                    barBorderRadius: 30,
                    color: function (params) {
                        var num = myColor.length;
                        return myColor[params.dataIndex % num]
                    },
                }
            },
            label: {
                normal: {
                    show: true,
                    position: 'inside',
                    formatter: '{c}%'
                }
            },
        }, {
            name: '框',
            type: 'bar',
            yAxisIndex: 1,
            barGap: '-100%',
            data: [100, 100, 100, 100, 100, 100],
            barWidth: 14,
            itemStyle: {
                normal: {
                    color: 'none',
                    borderColor: '#00c1de',
                    borderWidth: 1,
                    barBorderRadius: 30,
                }
            }
        },]
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);   //小中等屏幕
    Chart.setOption(option);   //大型屏幕
}


function myChartFun(titlename,valdata,data,dataLength){
    var myChart = echarts.init(document.getElementById('main'));

    // var myColor = ['#1089E7', '#F57474', '#56D0E3', '#1089E7', '#F57474', '#56D0E3'];
    var myColor = ["#00a2e4"];
    option = {
        // backgroundColor: '#0e2147',
        xAxis: {
            show: false
        },
        yAxis: [{
            show: true,
            data: titlename,
            inverse: true,
            axisLine: {
                show: false
            },
            splitLine: {
                show: false
            },
            axisTick: {
                show: false
            },
            axisLabel: {
                color: '#fff',
                formatter: function (value, index) {
                    return [
                        '{lg|' + (index + 1) + '}' + '{title|' + value + '} '
                    ].join('\n')
                },
                rich: {
                    lg: {
                        backgroundColor: '#339911',
                        color: '#fff',
                        borderRadius: 15,
                        // padding: 5,
                        align: 'center',
                        width: 5,
                        height: 5
                    },
                }
            },


        }, {
            show: true,
            inverse: true,
            data: valdata,
            axisLabel: {
                textStyle: {
                    fontSize: 12,
                    color: '#fff',
                },
            },
            axisLine: {
                show: false
            },
            splitLine: {
                show: false
            },
            axisTick: {
                show: false
            },

        }],
        series: [{
            name: '条',
            type: 'bar',
            yAxisIndex: 0,
            data: data,
            barWidth: 20,
            itemStyle: {
                normal: {
                    barBorderRadius: 30,
                    color: function (params) {
                        var num = myColor.length;
                        return myColor[params.dataIndex % num]
                    },
                }
            },
            label: {
                normal: {
                    show: true,
                    position: 'inside',
                    formatter: '{c}%'
                }
            },
        }, {
            name: '框',
            type: 'bar',
            yAxisIndex: 1,
            barGap: '-100%',
            data: dataLength,
            barWidth: 14,
            itemStyle: {
                normal: {
                    color: 'none',
                    borderColor: '#00c1de',
                    borderWidth: 1,
                    barBorderRadius: 30,
                }
            }
        },]
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
}


var g = 0;
function rotatex() {
    g += 360;
    $(".number").css('transform', 'rotateX(' + g + 'deg)');

}
